home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Controls.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  6.9 KB  |  243 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Controls.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __CONTROLS__
  13. #define __CONTROLS__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. #endif
  18.  
  19.  
  20. enum {
  21.  
  22.  pushButProc = 0,
  23.  checkBoxProc = 1,
  24.  radioButProc = 2,
  25.  useWFont = 8,
  26.  scrollBarProc = 16,
  27.  inButton = 10,
  28.  inCheckBox = 11,
  29.  inUpButton = 20,
  30.  inDownButton = 21,
  31.  inPageUp = 22,
  32.  inPageDown = 23,
  33.  inThumb = 129,
  34.  
  35.  popupMenuProc = 1008,        /* 63 * 16 */
  36.  inLabel = 1,
  37.  inMenu = 2,
  38.  inTriangle = 4
  39. };
  40.  
  41. enum { popupFixedWidth  = 1 << 0, popupReserved   = 1 << 1, popupUseAddResMenu = 1 << 2,
  42.   popupUseWFont  = 1 << 3};
  43.  
  44. enum { popupTitleBold  = 1 << 8, popupTitleItalic = 1 << 9, popupTitleUnderline = 1 << 10,
  45.   popupTitleOutline = 1 << 11, popupTitleShadow = 1 << 12, popupTitleCondense = 1 << 13,
  46.   popupTitleExtend = 1 << 14, popupTitleNoStyle = 1 << 15};
  47.  
  48.  
  49. enum {
  50.  
  51.  popupTitleLeftJust = 0x00000000,
  52.  popupTitleCenterJust = 0x00000001,
  53.  popupTitleRightJust = 0x000000FF,
  54.  
  55. /*
  56. axis constraints for DragGrayRgn call*/
  57.  noConstraint = 0,
  58.  hAxisOnly = 1,
  59.  vAxisOnly = 2,
  60.  
  61. /*
  62. control messages*/
  63.  drawCntl = 0,
  64.  testCntl = 1,
  65.  calcCRgns = 2,
  66.  initCntl = 3,
  67.  dispCntl = 4,
  68.  posCntl = 5,
  69.  thumbCntl = 6,
  70.  dragCntl = 7,
  71.  autoTrack = 8,
  72.  calcCntlRgn = 10,
  73.  calcThumbRgn = 11,
  74.  
  75.  cFrameColor = 0,
  76.  cBodyColor = 1,
  77.  cTextColor = 2
  78. };
  79. enum {
  80.  cThumbColor = 3
  81. };
  82.  
  83. struct ControlRecord {
  84.  struct ControlRecord **nextControl;
  85.  WindowPtr contrlOwner;
  86.  Rect contrlRect;
  87.  unsigned char contrlVis;
  88.  unsigned char contrlHilite;
  89.  short contrlValue;
  90.  short contrlMin;
  91.  short contrlMax;
  92.  Handle contrlDefProc;
  93.  Handle contrlData;
  94.  ProcPtr contrlAction;
  95.  long contrlRfCon;
  96.  Str255 contrlTitle;
  97. };
  98.  
  99. typedef struct ControlRecord ControlRecord;
  100. typedef ControlRecord *ControlPtr, **ControlHandle;
  101.  
  102.  
  103. struct CtlCTab {
  104.  long ccSeed;                /*reserved*/
  105.  short ccRider;                /*see what you have done - reserved*/
  106.  short ctSize;                /*usually 3 for controls*/
  107.  ColorSpec ctTable[4];
  108. };
  109.  
  110. typedef struct CtlCTab CtlCTab;
  111. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  112.  
  113. struct AuxCtlRec {
  114.  Handle acNext;                /*handle to next AuxCtlRec*/
  115.  ControlHandle acOwner;        /*handle for aux record's control*/
  116.  CCTabHandle acCTable;        /*color table for this control*/
  117.  short acFlags;                /*misc flag byte*/
  118.  long acReserved;            /*reserved for use by Apple*/
  119.  long acRefCon;                /*for use by application*/
  120. };
  121.  
  122. typedef struct AuxCtlRec AuxCtlRec;
  123. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle;
  124.  
  125.  
  126. #ifdef __cplusplus
  127. extern "C" {
  128. #endif
  129. pascal ControlHandle NewControl(WindowPtr theWindow,const Rect *boundsRect,
  130.  ConstStr255Param title,Boolean visible,short value,short min,short max,
  131.  short procID,long refCon)
  132.  = 0xA954; 
  133. pascal void SetControlTitle(ControlHandle theControl,ConstStr255Param title)
  134.  = 0xA95F; 
  135. pascal void SetCTitle(ControlHandle theControl,ConstStr255Param title)
  136.  = 0xA95F; 
  137. pascal void GetControlTitle(ControlHandle theControl,Str255 title)
  138.  = 0xA95E; 
  139. pascal void GetCTitle(ControlHandle theControl,Str255 title)
  140.  = 0xA95E; 
  141. pascal ControlHandle GetNewControl(short controlID,WindowPtr owner)
  142.  = 0xA9BE; 
  143. pascal void DisposeControl(ControlHandle theControl)
  144.  = 0xA955; 
  145. pascal void KillControls(WindowPtr theWindow)
  146.  = 0xA956; 
  147. pascal void HideControl(ControlHandle theControl)
  148.  = 0xA958; 
  149. pascal void ShowControl(ControlHandle theControl)
  150.  = 0xA957; 
  151. pascal void DrawControls(WindowPtr theWindow)
  152.  = 0xA969; 
  153. pascal void Draw1Control(ControlHandle theControl)
  154.  = 0xA96D; 
  155. pascal void HiliteControl(ControlHandle theControl,short hiliteState)
  156.  = 0xA95D; 
  157. pascal void UpdateControls(WindowPtr theWindow,RgnHandle updateRgn)
  158.  = 0xA953; 
  159. pascal void UpdtControl(WindowPtr theWindow,RgnHandle updateRgn)
  160.  = 0xA953; 
  161. pascal void MoveControl(ControlHandle theControl,short h,short v)
  162.  = 0xA959; 
  163. pascal void SizeControl(ControlHandle theControl,short w,short h)
  164.  = 0xA95C; 
  165. pascal void SetControlValue(ControlHandle theControl,short theValue)
  166.  = 0xA963; 
  167. pascal void SetCtlValue(ControlHandle theControl,short theValue)
  168.  = 0xA963; 
  169. pascal short GetControlValue(ControlHandle theControl)
  170.  = 0xA960; 
  171. pascal short GetCtlValue(ControlHandle theControl)
  172.  = 0xA960; 
  173. pascal void SetControlMinimum(ControlHandle theControl,short minValue)
  174.  = 0xA964; 
  175. pascal void SetCtlMin(ControlHandle theControl,short minValue)
  176.  = 0xA964; 
  177. pascal short GetControlMinimum(ControlHandle theControl)
  178.  = 0xA961; 
  179. pascal short GetCtlMin(ControlHandle theControl)
  180.  = 0xA961; 
  181. pascal void SetControlMaximum(ControlHandle theControl,short maxValue)
  182.  = 0xA965; 
  183. pascal void SetCtlMax(ControlHandle theControl,short maxValue)
  184.  = 0xA965; 
  185. pascal short GetControlMaximum(ControlHandle theControl)
  186.  = 0xA962; 
  187. pascal short GetCtlMax(ControlHandle theControl)
  188.  = 0xA962; 
  189. pascal void SetControlReference(ControlHandle theControl,long data)
  190.  = 0xA95B; 
  191. pascal void SetCRefCon(ControlHandle theControl,long data)
  192.  = 0xA95B; 
  193. pascal long GetControlReference(ControlHandle theControl)
  194.  = 0xA95A; 
  195. pascal long GetCRefCon(ControlHandle theControl)
  196.  = 0xA95A; 
  197. pascal void SetControlAction(ControlHandle theControl,ProcPtr actionProc)
  198.  = 0xA96B; 
  199. pascal void SetCtlAction(ControlHandle theControl,ProcPtr actionProc)
  200.  = 0xA96B; 
  201. pascal ProcPtr GetControlAction(ControlHandle theControl)
  202.  = 0xA96A; 
  203. pascal ProcPtr GetCtlAction(ControlHandle theControl)
  204.  = 0xA96A; 
  205. pascal void DragControl(ControlHandle theControl,Point startPt,const Rect *limitRect,
  206.  const Rect *slopRect,short axis)
  207.  = 0xA967; 
  208. pascal short TestControl(ControlHandle theControl,Point thePt)
  209.  = 0xA966; 
  210. pascal short TrackControl(ControlHandle theControl,Point thePoint,ProcPtr actionProc)
  211.  = 0xA968; 
  212. pascal short FindControl(Point thePoint,WindowPtr theWindow,ControlHandle *theControl)
  213.  = 0xA96C; 
  214. pascal void SetControlColor(ControlHandle theControl,CCTabHandle newColorTable)
  215.  = 0xAA43; 
  216. pascal void SetCtlColor(ControlHandle theControl,CCTabHandle newColorTable)
  217.  = 0xAA43; 
  218. pascal Boolean GetAuxiliaryControlRecord(ControlHandle theControl,AuxCtlHandle *acHndl)
  219.  = 0xAA44; 
  220. pascal Boolean GetAuxCtl(ControlHandle theControl,AuxCtlHandle *acHndl)
  221.  = 0xAA44; 
  222. pascal short GetControlVariant(ControlHandle theControl)
  223.  = 0xA809; 
  224. pascal short GetCVariant(ControlHandle theControl)
  225.  = 0xA809; 
  226. void dragcontrol(ControlHandle theControl,Point *startPt,const Rect *limitRect,
  227.  const Rect *slopRect,short axis); 
  228. ControlHandle newcontrol(WindowPtr theWindow,const Rect *boundsRect,char *title,
  229.  Boolean visible,short value,short min,short max,short procID,long refCon); 
  230. short findcontrol(Point *thePoint,WindowPtr theWindow,ControlHandle *theControl); 
  231. void getcontroltitle(ControlHandle theControl,char *title); 
  232. void getctitle(ControlHandle theControl,char *title); 
  233. void setcontroltitle(ControlHandle theControl,char *title); 
  234. void setctitle(ControlHandle theControl,char *title); 
  235. short trackcontrol(ControlHandle theControl,Point *thePoint,ProcPtr actionProc); 
  236. short testcontrol(ControlHandle theControl,Point *thePt); 
  237.  
  238. #ifdef __cplusplus
  239. }
  240. #endif
  241.  
  242. #endif
  243.